home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d20
/
eft100.arc
/
ARCHEAD.BTM
next >
Wrap
Text File
|
1991-07-03
|
6KB
|
184 lines
@echo off
rem THIS WILL ONLY RUN WITH *** 4DOS ***
rem ╔══════════════════════════════════════════════════════════════════════════╗
rem ║ ║
rem ║ ArcHead V 0.2 BONUS Archive header and unwanted files manipulator ║
rem ║ for use with Enhanced File Transfer ║
rem ║ ║
rem ║ Variables to adapt to your system: ║
rem ║ ║
rem ║ headfilename ... name of PD and CUG header file, will be inserted ║
rem ║ as archive header ║
rem ║ ║
rem ║ unwantedfname ... plain ASCII file contains names of unwanted ║
rem ║ files (e.g. commericals from other BBSs), one file ║
rem ║ per line. All files listed here will be erased ║
rem ║ from the archive. ║
rem ║ ║
rem ║ Note! Exclamation mark parameter "!" great for usage under ║
rem ║ EFT: Switches to non color batch mode ,so that ArcHead will stay ║
rem ║ in EFT window. Example: ║
rem ║ ║
rem ║ ArcHead C! pct7_1v8.zip pct7_2v8.zip new*.arj ║
rem ║ ║
rem ╚══════════════════════════════════════════════════════════════════════════╝
setlocal
set version = 0.2
if %@len[%1] EQ 1 goto headparmok
if %@len[%1] EQ 2 goto headparmok
goto noheadparm
:headparmok
set unwantedfname = x:\dos\arc\unwanted.fil
set headfilename = x:\dos\utils\w.i
if (%@substr[%@upper[%1],0,1]) == (C) set headfilename = x:\dos\utils\wi.cug
if (%@substr[%@upper[%1],1,1]) == (!) set quiet = ON
set lineheader = x:\dos\utils\w.i2
gosub archeadline
if (%2) == () goto nofilenames
:loop
if (%2) == () goto end
iff (%@ext[%2]) NE () then^set parm=%@name[%2].%@ext[%2]^
else^set parm=%@name[%2]^
endiff
iff (%@path[%2]) NE () then^pushd^cdd %@substr[%@path[%2],0,%@eval[%@len[%@path[%2]]-1]] len^endiff
if (%@ext[%parm]) == () goto noextension
:extension
for %filename in (%parm) do gosub %@ext[%filename]
goto goloop
:noextension
for %%filename in (%parm.zip %parm.lzh %parm.ice %parm.arj %parm.zoo %parm.dwc %parm.sdn %parm.pak %parm.arc) do gosub %@ext[%filename]
:goloop
if (%@path[%2]) NE () popd
shift
goto loop
:noheadparm
gosub archeadline
iff (%quiet) == () color bright green on black
text
Syntax: ArcHead {C|P}{!} [[Lw:][\Pfad\Filename.[Ext]] ...]
! ! !
CUG / PUBLIC header
! !
! File(s)
!
Optional exclamation mark switches to
non color batch mode
endtext
iff (%quiet) == () color white on black
goto end
:nofilenames
for %filename in (*.zip *.lzh *.ice *.arj *.zoo *.dwc *.sdn *.pak *.arc) do gosub %@ext[%filename]
goto end
:zip
gosub display_del
pkzip -d -! %filename @%unwantedfname > NUL:
gosub display_header
pkzip -z -! %filename < %headfilename > NUL:
return
:lzh
:ice
gosub display_del
lha d -wc:\tmp -m %filename < %unwantedfname > NUL:
if (%@ext[%filename])==(ICE) ren %filename %@name[%filename].LZH
return
:arj
gosub display_del
arj d -yi %filename !%unwantedfname > NUL:
gosub display_header
arj c -yi %filename -z%headfilename > NUL:
return
:zoo
set line = 1
set old =
:zoo_weiter
set new = %@line[x:\dos\arc\unwanted.fil,%line]
if %old == %new return
zoo -delete %filename %new > NUL:
gosub display_status
set old = %new
set line = %@eval[%line + 1]
goto zoo_weiter
:dwc
set line = 1
set old =
:dwc_weiter
set new = %@line[x:\dos\arc\unwanted.fil,%line]
if %old == %new goto dwc_end
gosub display_status
dwc d! %filename %new
set old = %new
set line = %@eval[%line + 1]
goto dwc_weiter
:dwc_end
gosub display_header
dwc a! %filename %headfilename
dwc h! %filename %@name[%headfilename].%@ext[%headfilename]
return
:sdn
:pak
gosub display_del
pak d %filename @%unwantedfname > NUL:
gosub display_header
pak h %filename < %headfilename > NUL:
if (%@ext[%filename])==(SDN) ren %filename %@name[%filename].PAK
return
:arc
gosub display_del
pkpak -x %filename < %lineheader > NUL:
gosub display_header
pkpak -d %filename @%unwantedfname > NUL:
return
:display_status
echo deleting "%new" in archive %filename
return
:display_header
iff (%quiet) == () color green on black
echo inserting header %headfilename
iff (%quiet) == () color white on black
return
:display_del
iff (%quiet) == () color green on black
echo deleting files in %unwantedfname from %filename
iff (%quiet) == () color white on black
return
:archeadline
iff (%quiet) == () then^
cls^
color bright white on blue^
echo ■ ArcHead V%version Archive header and unwanted files manipulator ^
color white on black^
else^
echo ■ ArcHead V%version^
endiff
return
:end
iff (%quiet) == () color green on black
echo ■ Bye from ArcHead V%version (C) The Wizard's Inn II BBS ++49-2307-21968
iff (%quiet) == () color white on black
endlocal